<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        let persons = [{
                username: '张飞',
                sex: '男',
                salary: 50000
            },
            {
                username: '关羽',
                sex: '男',
                salary: 60000
            }
        ]


        var set = persons.map(function (v, i) {
            var json = {};
            for (var key in v) {
                if (key == 'salary') {
                    json[key] = v.salary + 2000
                } else {
                    json[key] = v[key]
                }
            }
            return json
        });
        console.log(set);
        console.log(persons);
    </script>
</body>

</html>